<?php
require_once( 'Zend/Db.php' );
require_once( 'Zend/Db/Table.php' );
require_once( 'Zend/Db/Table/Abstract.php' );

class DIAS_DE_TRABAJO extends Zend_Db_Table_Abstract
{
	protected $_name = 'DIAS_DE_TRABAJO';
	
	public function trabajadia() {
        $select = $this->select();
        $select->from($this->_name,'COUNT(*) AS num' );
        
        $where = $this->_where($select, "PEDNI = '" . $this->dni . "' AND DIA = '" . $this->adia . "'" );
        $result = $this->fetchRow($where)->num;

        return $result;
    }
    
    public function desdehasta() {
    	
    $where = "PEDNI = '" . $this->medico."'";
            $result = $this->fetchAll($where ,null,10,0);
            return $result;
        
    }
}


